package com.cursojava.copaamerica.dao.impl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.cursojava.copaamerica.dao.PaisDAO;
import com.cursojava.copaamerica.domain.Pais;

@Repository
public class PaisDAOImpl implements PaisDAO {

	@Autowired
    private SessionFactory sessionFactory;

	

	public List<Pais> getPaisesGrupo(String grupo) {
		 return sessionFactory.getCurrentSession().createQuery("from Pais p where p.grupo = '"+grupo+"'").list();
	}

}
